import 'package:flutter/material.dart';
import 'package:scoped_model/scoped_model.dart';
import 'CountModel.dart';

class ScopedTwo extends StatefulWidget {
  @override
  _TwoState createState() => new _TwoState();
}

class _TwoState extends State<ScopedTwo> {
  @override
  Widget build(BuildContext context) {
    return ScopedModelDescendant<CountModel>(
      builder: (context, child, model) {
        return Scaffold(
          appBar: AppBar(
            title: Text("Scoped测试子页"),
          ),
          floatingActionButton: FloatingActionButton(
            onPressed: () => Navigator.pop(context),
            child: Text("返回"),
          ),
          body: Center(
            child: Text(model.count.toString()),
          ),
        );
      },
    );
  }
}
